package main

//import  . "../../Symmetric"
import (
	"../../Symmetric"
	"fmt"
	"encoding/hex"
	"strings"
)
func main1(){
	var mydata  Symmetric.SymmetricInterface
	mydata =new(Symmetric.DES3)
	var data[]byte=mydata.Encrypt([]byte("12345678"),[]byte("1235678123456781231321312313123231312"))
	fmt.Println(string(data))
	fmt.Println(hex.EncodeToString(data))
	fmt.Println("二进制",data)
	mystr:=hex.EncodeToString(data)
	datax,_:=hex.DecodeString(mystr)
	fmt.Println("二进制",datax)
	fmt.Println("s",string(mydata.Decrypt(data,[]byte("1235678123456781231321312313123231312"))))

}
func main2(){
	var mydata  Symmetric.SymmetricInterface
	mydata =new(Symmetric.DES3)
	cdata:=mydata.EncryptString("12345","xyzab12312312c")
	fmt.Println(cdata)
	fmt.Println(mydata.DecryptString(cdata,"xyzabc123213132"))
}
func main3(){
	path:="C:\\Users\\Tsinghua-yincheng\\Desktop\\day12\\今日任务.txt"
	//path:="C:\\Users\\Tsinghua-yincheng\\Desktop\\day12\\en_今日任务.txt"
	//path:="C:\\Users\\Tsinghua-yincheng\\Desktop\\day12\\de_今日任务.txt"
	filelist:=strings.Split(path,"\\")
	lastpath:=""
	for i:=0;i<len(filelist)-1;i++{
		lastpath+=filelist[i]+"\\"
	}
	lastpath+="en_"
	lastpath+=filelist[len(filelist)-1]
	fmt.Println(lastpath)

}

func main(){
	var mydata  Symmetric.SymmetricInterface
	mydata =new(Symmetric.DES3)
	path:="C:\\Users\\Tsinghua-yincheng\\Desktop\\day12\\今日任务.txt"
	enpath:=mydata.EncryptFilePath(path,"abcdefg")
	enpath=mydata.EncryptFilePath(enpath,"abcdefg")

	depath:=mydata.DecryptFilePath(enpath,"abcdefg")
	depath=mydata.DecryptFilePath(	depath,"abcdefg")
	fmt.Println(depath)
}